<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>计数器</title>
    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
</head>

<body>
    <div id="app">
        <p>计数: {{ count }}</p>
        <button @click="increment">增加</button>
    </div>
    <script>
        const { createApp } = Vue;

        const app = createApp({
            data() {
                return {
                    count: 0
                };
            },
            methods: {
                increment() {
                    this.count++;
                }
            }
        });

        app.mount('#app');
    </script>
</body>

</html>